home *** CD-ROM | disk | FTP | other *** search
/ IRIX 5.3 for Indy R4400 / IRIX 5.3 for Indy R4400 175MHz.img / dist / eoe2.idb / usr / sadm / install / scripts / i.build.z / i.build
Text File  |  1995-02-28  |  643b  |  46 lines

  1. #ident    "@(#)oampkg:pkgscripts/i.build    1.6"
  2.  
  3. error=no
  4. while read src dest
  5. do
  6.     [ "$src" = /dev/null ] && continue
  7.  
  8.     echo "Modifying $dest"
  9.  
  10.     savepath=$PKGSAV/build${dest}
  11.     dirname=`dirname $savepath`
  12.     if [ $? -ne 0 ]
  13.     then
  14.         error=yes
  15.         continue
  16.     fi
  17.  
  18.     if [ ! -d $dirname ]
  19.     then
  20.         # ignore return since mkdir has bug
  21.         mkdir -p $dirname
  22.     fi
  23.  
  24.     cp $src $savepath &&
  25.         chmod 500 $savepath
  26.     if [ $? -ne 0 ]
  27.     then
  28.         error=yes
  29.         continue
  30.     fi
  31.  
  32.     if $savepath install $dest > /tmp/$$build
  33.     then
  34.         if [ -s /tmp/$$build ]
  35.         then
  36.             cp /tmp/$$build $dest || error=yes
  37.         fi
  38.     else
  39.         error=yes
  40.     fi
  41.     rm -f /tmp/$$build
  42. done
  43. [ "$error" = yes ] &&
  44.     exit 2
  45. exit 0
  46.